# 闭包运用--定制幂函数
# 定制函数: baseNum^n，基数baseNum由用户自己定
def mypowerFunc(baseNum):
    def power(n):
        result = baseNum**n
        return result
    return power


func1 = mypowerFunc(2)  # 2^n
print(func1(10))

func2 = mypowerFunc(3)  # 3^n
print(func2(3))